package com.youxuan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youxuan.mapper.CategoryMapper;
import com.youxuan.pojo.entity.Category;
import com.youxuan.pojo.entity.ResponseResult;
import com.youxuan.pojo.vo.PageVo;
import com.youxuan.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {

    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public ResponseResult<List<Category>> getList() {
        LambdaQueryWrapper<Category> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Category::getDelFlag,0);
        List<Category> categories = categoryMapper.selectList(queryWrapper);
        return ResponseResult.okResult(categories);
    }
}
